/**
 * @author WRP
 */

angular.module('myCalendar',[]).directive('myCalendar',function () {
	return {
		restrict: 'AE',
    	scope: {
    		dadosCalendarioObj :'=parametros'
    	},
    	replace: true,
    	transclude: true,
	 	templateUrl: './view/componentes/html/calendar.php',
	 	controller: function ($scope, $http, $attrs) {
	    	
	    	$scope.today = function() {
				$scope.dt = new Date();
			};
				  
			$scope.today();
			
			$scope.open = function($event) {
				$event.preventDefault();
				$event.stopPropagation();
			
			    $scope.opened = true;
		    };
		    
		    $scope.dadosCalendarioObj.getDate = function(){
		    	return $scope.dt;
		    	
		    };
		    
		    $scope.dadosCalendarioObj.setDate = function(data){
		    	$scope.dt = data;
		    	
		    };
			  	
		}
	};
});






